split in 3 competitions#283
Merged
Merged
Conversation
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors validator scoring to split emissions across three competitions (Crypto 1h, Crypto 24h, Commodities/Equities 24h) by introducing a CompetitionConfig abstraction and updating scoring/moving-average pipelines, tests, and docs accordingly.
Changes:
- Added
synth/validator/competition_config.pyand updated scoring logic to pass competition metadata (asset list, intervals, window, beta) through reward + moving-average computations. - Updated DB query paths to filter scoring/moving-average inputs by both
time_lengthandasset_list. - Updated tests and documentation to reflect the new 3-competition structure and miner response format.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| validator.config.js | Removes now-deleted CLI args from PM2 validator scoring config. |
| tests/test_sequential_scheduler.py | Updates PromptConfig construction to match removed fields. |
| tests/test_rewards.py | Updates scoring calls to pass competition config. |
| tests/test_moving_average.py | Updates moving-average tests to use CompetitionConfig. |
| tests/test_moving_average_unit.py | Updates unit tests to use new competition config + coefficient constant. |
| tests/test_miner_data_handler.py | Updates handler calls to include time_length + asset_list and competition config. |
| tests/test_forward.py | Updates forward-path tests to use competitions and updated handler APIs. |
| tests/test_calculate_crps.py | Updates CRPS tests to use scoring intervals from competition configs. |
| synth/validator/reward.py | Changes reward computation to accept CompetitionConfig for scoring intervals. |
| synth/validator/prompt_config.py | Simplifies prompt config to scheduling-related fields and updates asset lists. |
| synth/validator/moving_average.py | Moves softmax beta to competition config and scales weights by 1/3 constant. |
| synth/validator/miner_data_handler.py | Requires time_length and asset_list for request/score retrieval; filters by asset. |
| synth/validator/forward.py | Iterates over 3 competitions for scoring and moving-average computation. |
| synth/validator/competition_config.py | New: defines the three competitions and shared coefficient constant. |
| synth/utils/sequential_scheduler.py | Removes date-gated asset slicing logic and timezone import. |
| synth/utils/config.py | Removes deprecated CLI args for SMA windows and softmax betas. |
| README.md | Updates competition description, miner result format example, and competition parameters. |
| neurons/validator.py | Scores across 3 competitions in the scoring cycle. |
| miner.config.js | Updates miner stake threshold. |
| entrypoint-validator.sh | Removes deprecated SMA/softmax CLI args from validator startup script. |
| docs/validator_guide.md | Removes documentation for deleted SMA/softmax CLI args. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the validator's emissions model from 2 competitions (
1h/24h, keyed only ontime_length) into 3 competitions, each receiving an equal 1/3 share of emissions:Asset changes
BTC, ETH, SOL, XRP, HYPE(updated on both the request-generation sideHIGH_FREQUENCY.asset_listand the scoring sideCRYPTO_1H).ASSET_COEFFICIENTSweight); crypto and commodities/equities are now scored as two separate 24h competitions.Changes
New scoring config
synth/validator/competition_config.py— newCompetitionConfigdataclass + the 3 competition instances andSMOOTHED_SCORE_COEFFICIENT = 1/3.prompt_config.py—PromptConfigslimmed to request-scheduling only;scoring_intervals/window_days/softmax_beta/smoothed_score_coefficientmoved toCompetitionConfig.HIGH_FREQUENCY/LOW_FREQUENCYasset lists updated.Scoring pipeline
forward.py/neurons/validator.py— scoring and moving-average now iterate the 3 competitions; per-miner reward weights are summed across competitions, each scaled by1/3.reward.py—get_rewards_multiprocesstakes thecompconfig; removed_get_scoring_intervals(intervals come from the competition now).moving_average.py—compute_smoothed_scoretakescomp; uses the module-levelSMOOTHED_SCORE_COEFFICIENT.miner_data_handler.py—get_validator_requests_to_scoreandget_miner_scoresnow filter by the competition'sasset_list(andtime_lengthis required), so the two 24h competitions are separated by asset.Cleanup
--sma.low/high.daysand--softmax.low/high.betaCLI flags (config.py), theirentrypoint-validator.shvars, and the matchingvalidator.config.jsargs +docs/validator_guide.mdsections.sequential_scheduler.py.README.mdupdated to describe the 3-competition model.Note on DB load (
assetfilter)The new
asset IN (...)/asset = ANY(...)predicates do not require a new index. In both scoring queriesassetis a post-filter on rows already fetched by the existing access path (start_timerange for the request query;scored_timerange + PK joins for the scores query), over a bounded rolling window — so the predicate itself adds negligible load.The modest cost change is structural: because Crypto 24h and Commodities/Equities 24h share
time_length = 86400, the 24h window is scanned once per 24h competition, so the scoring queries run 3×/cycle instead of 2×. If profiling later shows this hot, a compositevalidator_requests (time_length, asset, start_time)is the candidate — but it should be validated withEXPLAIN (ANALYZE, BUFFERS)before adding, given the write cost on that table.Tests
Updated all affected tests to the new
CompetitionConfigAPI and the requiredtime_length/asset_listquery args:test_forward,test_rewards,test_miner_data_handler,test_moving_average,test_moving_average_unit,test_calculate_crps,test_sequential_scheduler.Verified locally: full touched test suite passes (testcontainers Postgres + live price history),
black --check .andflake8 .clean.🤖 Generated with Claude Code